<script setup>
import { useRoute, useRouter } from 'vue-router'
const route = useRoute()
// route====this.$route
const router = useRouter()
// router===this.$router
const btnClick = () => {
  console.log('route', route.path)
}
const btnClick2 = () => {
  router.push('/')
}
</script>
<template>
  <div>login</div>
  <button @click="btnClick">获取当前路由的基本信息</button>
  <button @click="btnClick2">跳转到首页</button>
</template>
<style></style>
